package Controller;

import java.io.File;
import javax.swing.*;
import javax.swing.filechooser.*;

public class OpenImageFilter extends FileFilter {

    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }

        String extension = Utils.getExtension(f);
        if (extension != null) {
            if (extension.equals("bmp") ||
                    extension.equals("jpg") ||
                    extension.equals("png")) {
                return true;
            } else {
                return false;
            }
        }

        return false;
    }

    public String getDescription() {
        return "Images (.bmp, .jpg, .png)";
    }
}
